package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.LeafToken;
import com.ruoyi.system.mapper.LeafTokenMapper;
import com.ruoyi.system.service.LeafTokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @description: TODO
 * @Author: Zhuzhi
 * @Date: 2020/12/13 下午2:15
 */
@Service
public class LeafTokenServiceImpl implements LeafTokenService {

    @Autowired
    LeafTokenMapper leafTokenMapper;

    @Override
    public List<LeafToken> selectLeafTokenList(String appId, String token) {
        Map<String, String> paramMap = new HashMap<>();
        paramMap.put("appId", appId);
        paramMap.put("token", token);
        return leafTokenMapper.selectLeafTokenList(paramMap);
    }

    @Override
    public int insertLeafToken(LeafToken leafToken) {
        return leafTokenMapper.insertLeafToken(leafToken);
    }

    @Override
    public LeafToken selectLeafToken(String appId, String token) {
        Map<String, String> paramMap = new HashMap<>();
        paramMap.put("appId", appId);
        paramMap.put("token", token);
        return leafTokenMapper.selectLeafToken(paramMap);
    }

    @Override
    public int deleteLeafTokenById(long id) {
        return leafTokenMapper.deleteLeafTokenById(id);
    }
}
